/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cube;

import javax.swing.*;
import java.awt.*;
import java.awt.geom.Ellipse2D;

/**
 *
 * @author charmgil
 */
public class CubeExt extends JPanel{

	public CubeExt(){
		super();

        }

	public void paint(Graphics g) {
		Graphics2D g2 = (Graphics2D)g;
		double x = 15, y = 50, w = 70, h = 70;
		Ellipse2D e = new Ellipse2D.Double(x, y, w, h);
		GradientPaint gp = new GradientPaint(75, 75, Color.white,
		    95, 95, Color.gray, true);
		// Fill with a gradient.
		g2.setPaint(gp);
		g2.fill(e);
		// Stroke with a solid color.
		e.setFrame(x + 100, y, w, h);
		g2.setPaint(Color.black);
		g2.setStroke(new BasicStroke(8));
		g2.draw(e);
		// Stroke with a gradient.
		e.setFrame(x + 200, y, w, h);
		g2.setPaint(gp);
		g2.draw(e);
	}

	public static void main(String[] args) {
        JFrame frame = new JFrame();
        frame.setSize( 300, 300 );
        frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

        Container contentPane = frame.getContentPane();

        CubeExt panel = new CubeExt();
        contentPane.add( panel );

        frame.setVisible( true );

        return;
	}

}
